<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Relation Subjects</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Relation Subjects' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../inform7n.html">Inform7</a></li><li><a href="index.html">knowledge</a></li><li><a href="index.html#4">Chapter 4: Subjects</a></li><li><b>Relation Subjects</b></li></ul></div>
<p class="purpose">The relations family of inference subjects.</p>

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b>Every binary predicate has an associated subject:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">inference_subject_family</span><span class="plain-syntax"> *</span><span class="identifier-syntax">relations_family</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">inference_subject_family</span><span class="plain-syntax"> *</span><span class="function-syntax">RelationSubjects::family</span><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">relations_family</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">relations_family</span><span class="plain-syntax"> = </span><a href="4-is.html#SP1" class="function-link"><span class="function-syntax">InferenceSubjects::new_family</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">METHOD_ADD</span><span class="plain-syntax">(</span><span class="identifier-syntax">relations_family</span><span class="plain-syntax">, </span><span class="constant-syntax">GET_DEFAULT_CERTAINTY_INFS_MTID</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="4-rs.html#SP2" class="function-link"><span class="function-syntax">RelationSubjects::certainty</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">METHOD_ADD</span><span class="plain-syntax">(</span><span class="identifier-syntax">relations_family</span><span class="plain-syntax">, </span><span class="constant-syntax">CHECK_MODEL_INFS_MTID</span><span class="plain-syntax">, </span><a href="4-rs.html#SP4" class="function-link"><span class="function-syntax">RelationSubjects::check_model</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">METHOD_ADD</span><span class="plain-syntax">(</span><span class="identifier-syntax">relations_family</span><span class="plain-syntax">, </span><span class="constant-syntax">COMPLETE_MODEL_INFS_MTID</span><span class="plain-syntax">, </span><a href="4-rs.html#SP3" class="function-link"><span class="function-syntax">RelationSubjects::complete_model</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">METHOD_ADD</span><span class="plain-syntax">(</span><span class="identifier-syntax">relations_family</span><span class="plain-syntax">, </span><span class="constant-syntax">GET_NAME_TEXT_INFS_MTID</span><span class="plain-syntax">, </span><a href="4-rs.html#SP2" class="function-link"><span class="function-syntax">RelationSubjects::get_name</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">relations_family</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="function-syntax">RelationSubjects::from_bp</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">RelationSubjects::from_bp</span></span>:<br/><a href="4-rs.html#SP3">&#167;3</a>, <a href="4-rs.html#SP4">&#167;4</a><br/>Relation Inferences - <a href="5-ri.html#SP4">&#167;4</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">binary_predicate</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bp</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">bp</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">knowledge_about_bp</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="function-syntax">RelationSubjects::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">binary_predicate</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bp</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="4-is.html#SP7" class="function-link"><span class="function-syntax">InferenceSubjects::new</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">relations</span><span class="plain-syntax">, </span><a href="4-rs.html#SP1" class="function-link"><span class="function-syntax">RelationSubjects::family</span></a><span class="plain-syntax">(),</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">STORE_POINTER_binary_predicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">bp</span><span class="plain-syntax">), </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="identifier-syntax">binary_predicate</span><span class="plain-syntax"> *</span><span class="function-syntax">RelationSubjects::to_bp</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">RelationSubjects::to_bp</span></span>:<br/><a href="4-rs.html#SP3">&#167;3</a>, <a href="4-rs.html#SP4">&#167;4</a><br/>Inference Subjects - <a href="4-is.html#SP17">&#167;17</a><br/>The Model World - <a href="5-tmw.html#SP4_3">&#167;4.3</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">infs</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">infs</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">infs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">infs_family</span><span class="plain-syntax"> == </span><span class="identifier-syntax">relations_family</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">RETRIEVE_POINTER_binary_predicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">infs</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">represents</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">RelationSubjects::certainty</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">RelationSubjects::certainty</span></span>:<br/><a href="4-rs.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inference_subject_family</span><span class="plain-syntax"> *</span><span class="identifier-syntax">f</span><span class="plain-syntax">, </span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">infs</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">CERTAIN_CE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RelationSubjects::get_name</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">RelationSubjects::get_name</span></span>:<br/><a href="4-rs.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inference_subject_family</span><span class="plain-syntax"> *</span><span class="identifier-syntax">family</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">from</span><span class="plain-syntax">, </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> *</span><span class="identifier-syntax">W</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    *</span><span class="identifier-syntax">W</span><span class="plain-syntax"> = </span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">; </span><span class="comment-syntax"> nameless</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b>At model completion time, we need to do some work on equivalence relations:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RelationSubjects::complete_model</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">RelationSubjects::complete_model</span></span>:<br/><a href="4-rs.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inference_subject_family</span><span class="plain-syntax"> *</span><span class="identifier-syntax">family</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">infs</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">domain_size</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NUMBER_CREATED</span><span class="plain-syntax">(</span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">binary_predicate</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bp</span><span class="plain-syntax"> = </span><a href="4-rs.html#SP1" class="function-link"><span class="function-syntax">RelationSubjects::to_bp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">infs</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ExplicitRelations::stored_dynamically</span><span class="plain-syntax">(</span><span class="identifier-syntax">bp</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax">; </span><span class="comment-syntax"> handled at run-time</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">ExplicitRelations::get_form_of_relation</span><span class="plain-syntax">(</span><span class="identifier-syntax">bp</span><span class="plain-syntax">) == </span><span class="identifier-syntax">Relation_Equiv</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">bp</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">right_way_round</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">RTRelations::equivalence_relation_make_singleton_partitions</span><span class="plain-syntax">(</span><span class="identifier-syntax">bp</span><span class="plain-syntax">, </span><span class="identifier-syntax">domain_size</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *</span><span class="identifier-syntax">i</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">POSITIVE_KNOWLEDGE_LOOP</span><span class="plain-syntax">(</span><span class="identifier-syntax">i</span><span class="plain-syntax">, </span><a href="4-rs.html#SP1" class="function-link"><span class="function-syntax">RelationSubjects::from_bp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">bp</span><span class="plain-syntax">), </span><span class="identifier-syntax">relation_inf</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">infs0</span><span class="plain-syntax">, *</span><span class="identifier-syntax">infs1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><a href="5-ri.html#SP7" class="function-link"><span class="function-syntax">RelationInferences::get_term_subjects</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">i</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">infs0</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">infs1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">RTRelations::equivalence_relation_merge_classes</span><span class="plain-syntax">(</span><span class="identifier-syntax">bp</span><span class="plain-syntax">, </span><span class="identifier-syntax">domain_size</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">infs0</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">, </span><span class="identifier-syntax">infs1</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">RTRelations::equivalence_relation_add_properties</span><span class="plain-syntax">(</span><span class="identifier-syntax">bp</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. </b>We now check 1-to-1 relations to see if the initial conditions have
violated the 1-to-1-ness. Because of the way these relations are implemented
using a property, it seems in fact to be impossible to violate the left-hand
count &mdash; a contradiction problem is reported when the inference was generated.
But in case the implementation is ever changed, it seems prudent to leave this
checking in.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RelationSubjects::check_model</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">RelationSubjects::check_model</span></span>:<br/><a href="4-rs.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inference_subject_family</span><span class="plain-syntax"> *</span><span class="identifier-syntax">family</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">infs</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">binary_predicate</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bp</span><span class="plain-syntax"> = </span><a href="4-rs.html#SP1" class="function-link"><span class="function-syntax">RelationSubjects::to_bp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">infs</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">f</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ExplicitRelations::get_form_of_relation</span><span class="plain-syntax">(</span><span class="identifier-syntax">bp</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">bp</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">right_way_round</span><span class="plain-syntax">) &amp;&amp; ((</span><span class="identifier-syntax">f</span><span class="plain-syntax"> == </span><span class="identifier-syntax">Relation_OtoO</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">f</span><span class="plain-syntax"> == </span><span class="identifier-syntax">Relation_Sym_OtoO</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">        </span><a href="4-rs.html#SP4" class="function-link"><span class="function-syntax">RelationSubjects::check_OtoO_relation</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">bp</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">bp</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">right_way_round</span><span class="plain-syntax">) &amp;&amp; ((</span><span class="identifier-syntax">f</span><span class="plain-syntax"> == </span><span class="identifier-syntax">Relation_OtoV</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">f</span><span class="plain-syntax"> == </span><span class="identifier-syntax">Relation_VtoO</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">        </span><a href="4-rs.html#SP4" class="function-link"><span class="function-syntax">RelationSubjects::check_OtoV_relation</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">bp</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RelationSubjects::check_OtoO_relation</span><span class="plain-syntax">(</span><span class="identifier-syntax">binary_predicate</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bp</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">nc</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NUMBER_CREATED</span><span class="plain-syntax">(</span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">right_counts</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> *)</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Memory::calloc</span><span class="plain-syntax">(</span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax">), </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inference</span><span class="plain-syntax"> **</span><span class="identifier-syntax">right_first</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> **)</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Memory::calloc</span><span class="plain-syntax">(</span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *), </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inference</span><span class="plain-syntax"> **</span><span class="identifier-syntax">right_second</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> **)</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Memory::calloc</span><span class="plain-syntax">(</span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *), </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">));</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">property</span><span class="plain-syntax"> *</span><span class="identifier-syntax">prn</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ExplicitRelations::get_i6_storage_property</span><span class="plain-syntax">(</span><span class="identifier-syntax">bp</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">infs</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax">) </span><span class="identifier-syntax">right_counts</span><span class="plain-syntax">[</span><span class="identifier-syntax">infs</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">] = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *</span><span class="identifier-syntax">inf1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">leftc</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *</span><span class="identifier-syntax">inf</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">KNOWLEDGE_LOOP</span><span class="plain-syntax">(</span><span class="identifier-syntax">inf</span><span class="plain-syntax">, </span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="identifier-syntax">property_inf</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><a href="5-pi.html#SP8" class="function-link"><span class="function-syntax">PropertyInferences::get_property</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inf</span><span class="plain-syntax">) == </span><span class="identifier-syntax">prn</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">                (</span><a href="5-inf.html#SP3" class="function-link"><span class="function-syntax">Inferences::get_certainty</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inf</span><span class="plain-syntax">) == </span><span class="identifier-syntax">CERTAIN_CE</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><a href="5-pi.html#SP8" class="function-link"><span class="function-syntax">PropertyInferences::get_value</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inf</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">infs2</span><span class="plain-syntax"> = </span><a href="4-is.html#SP14" class="function-link"><span class="function-syntax">InferenceSubjects::from_specification</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">leftc</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">infs2</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">m</span><span class="plain-syntax"> = </span><span class="identifier-syntax">right_counts</span><span class="plain-syntax">[</span><span class="identifier-syntax">infs2</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">]++;</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">m</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">right_first</span><span class="plain-syntax">[</span><span class="identifier-syntax">infs2</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">] = </span><span class="identifier-syntax">inf</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">m</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">) </span><span class="identifier-syntax">right_second</span><span class="plain-syntax">[</span><span class="identifier-syntax">infs2</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">] = </span><span class="identifier-syntax">inf</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                }</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">leftc</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">) </span><span class="identifier-syntax">inf1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">inf</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">leftc</span><span class="plain-syntax"> == </span><span class="constant-syntax">2</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">StandardProblems::infs_contradiction_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">BelievedImpossible</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                        </span><a href="5-inf.html#SP3" class="function-link"><span class="function-syntax">Inferences::where_inferred</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inf1</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                        </span><a href="5-inf.html#SP3" class="function-link"><span class="function-syntax">Inferences::where_inferred</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inf</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                        </span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="string-syntax">"can only relate to one other thing in this way"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                        </span><span class="string-syntax">"since the relation in question is one-to-one."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                }</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">right_counts</span><span class="plain-syntax">[</span><span class="identifier-syntax">infs</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">] &gt;= </span><span class="constant-syntax">2</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">StandardProblems::infs_contradiction_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_Relation1to1Right</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                </span><a href="5-inf.html#SP3" class="function-link"><span class="function-syntax">Inferences::where_inferred</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">right_first</span><span class="plain-syntax">[</span><span class="identifier-syntax">infs</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">]),</span>
<span class="plain-syntax">                </span><a href="5-inf.html#SP3" class="function-link"><span class="function-syntax">Inferences::where_inferred</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">right_second</span><span class="plain-syntax">[</span><span class="identifier-syntax">infs</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">]),</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="string-syntax">"can only relate to one other thing in this way"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="string-syntax">"since the relation in question is one-to-one."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">Memory::I7_array_free</span><span class="plain-syntax">(</span><span class="identifier-syntax">right_second</span><span class="plain-syntax">, </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">, </span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Memory::I7_array_free</span><span class="plain-syntax">(</span><span class="identifier-syntax">right_first</span><span class="plain-syntax">, </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">, </span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Memory::I7_array_free</span><span class="plain-syntax">(</span><span class="identifier-syntax">right_counts</span><span class="plain-syntax">, </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">, </span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *));</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RelationSubjects::check_OtoV_relation</span><span class="plain-syntax">(</span><span class="identifier-syntax">binary_predicate</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bp</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">nc</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NUMBER_CREATED</span><span class="plain-syntax">(</span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">right_counts</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> *)</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Memory::calloc</span><span class="plain-syntax">(</span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax">), </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inference</span><span class="plain-syntax"> **</span><span class="identifier-syntax">right_first</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> **)</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Memory::calloc</span><span class="plain-syntax">(</span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *), </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inference</span><span class="plain-syntax"> **</span><span class="identifier-syntax">right_second</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> **)</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Memory::calloc</span><span class="plain-syntax">(</span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *), </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">left_counts</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> *)</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Memory::calloc</span><span class="plain-syntax">(</span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax">), </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inference</span><span class="plain-syntax"> **</span><span class="identifier-syntax">left_first</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> **)</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Memory::calloc</span><span class="plain-syntax">(</span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *), </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inference</span><span class="plain-syntax"> **</span><span class="identifier-syntax">left_second</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> **)</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Memory::calloc</span><span class="plain-syntax">(</span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *), </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">));</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">infs</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax">) </span><span class="identifier-syntax">right_counts</span><span class="plain-syntax">[</span><span class="identifier-syntax">infs</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">] = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *</span><span class="identifier-syntax">inf</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">POSITIVE_KNOWLEDGE_LOOP</span><span class="plain-syntax">(</span><span class="identifier-syntax">inf</span><span class="plain-syntax">, </span><a href="4-rs.html#SP1" class="function-link"><span class="function-syntax">RelationSubjects::from_bp</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">bp</span><span class="plain-syntax">), </span><span class="identifier-syntax">relation_inf</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">left_val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">right_val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><a href="5-ri.html#SP7" class="function-link"><span class="function-syntax">RelationInferences::get_term_specs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inf</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">left_val</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">right_val</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">left_infs</span><span class="plain-syntax"> = </span><a href="4-is.html#SP14" class="function-link"><span class="function-syntax">InferenceSubjects::from_specification</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">left_val</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">right_infs</span><span class="plain-syntax"> = </span><a href="4-is.html#SP14" class="function-link"><span class="function-syntax">InferenceSubjects::from_specification</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">right_val</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">left_id</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">left_infs</span><span class="plain-syntax">)?(</span><span class="identifier-syntax">left_infs</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">):(-1);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">right_id</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">right_infs</span><span class="plain-syntax">)?(</span><span class="identifier-syntax">right_infs</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">):(-1);</span>

<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">left_id</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">m</span><span class="plain-syntax"> = </span><span class="identifier-syntax">left_counts</span><span class="plain-syntax">[</span><span class="identifier-syntax">left_id</span><span class="plain-syntax">]++;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">m</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">left_first</span><span class="plain-syntax">[</span><span class="identifier-syntax">left_id</span><span class="plain-syntax">] = </span><span class="identifier-syntax">inf</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">m</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">) </span><span class="identifier-syntax">left_second</span><span class="plain-syntax">[</span><span class="identifier-syntax">left_id</span><span class="plain-syntax">] = </span><span class="identifier-syntax">inf</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>

<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">right_id</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">m</span><span class="plain-syntax"> = </span><span class="identifier-syntax">right_counts</span><span class="plain-syntax">[</span><span class="identifier-syntax">right_id</span><span class="plain-syntax">]++;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">m</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">right_first</span><span class="plain-syntax">[</span><span class="identifier-syntax">right_id</span><span class="plain-syntax">] = </span><span class="identifier-syntax">inf</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">m</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">) </span><span class="identifier-syntax">right_second</span><span class="plain-syntax">[</span><span class="identifier-syntax">right_id</span><span class="plain-syntax">] = </span><span class="identifier-syntax">inf</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ExplicitRelations::get_form_of_relation</span><span class="plain-syntax">(</span><span class="identifier-syntax">bp</span><span class="plain-syntax">) == </span><span class="identifier-syntax">Relation_VtoO</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">left_counts</span><span class="plain-syntax">[</span><span class="identifier-syntax">infs</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">] &gt;= </span><span class="constant-syntax">2</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">StandardProblems::infs_contradiction_problem</span><span class="plain-syntax">(</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_RelationVtoOContradiction</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                    </span><a href="5-inf.html#SP3" class="function-link"><span class="function-syntax">Inferences::where_inferred</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">left_first</span><span class="plain-syntax">[</span><span class="identifier-syntax">infs</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">]),</span>
<span class="plain-syntax">                    </span><a href="5-inf.html#SP3" class="function-link"><span class="function-syntax">Inferences::where_inferred</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">left_second</span><span class="plain-syntax">[</span><span class="identifier-syntax">infs</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">]),</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="string-syntax">"can only relate to one other thing in this way"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                    </span><span class="string-syntax">"since the relation in question is various-to-one."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">right_counts</span><span class="plain-syntax">[</span><span class="identifier-syntax">infs</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">] &gt;= </span><span class="constant-syntax">2</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">StandardProblems::infs_contradiction_problem</span><span class="plain-syntax">(</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_RelationOtoVContradiction</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                    </span><a href="5-inf.html#SP3" class="function-link"><span class="function-syntax">Inferences::where_inferred</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">right_first</span><span class="plain-syntax">[</span><span class="identifier-syntax">infs</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">]),</span>
<span class="plain-syntax">                    </span><a href="5-inf.html#SP3" class="function-link"><span class="function-syntax">Inferences::where_inferred</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">right_second</span><span class="plain-syntax">[</span><span class="identifier-syntax">infs</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">allocation_id</span><span class="plain-syntax">]),</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="string-syntax">"can only be related to by one other thing in this way"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                    </span><span class="string-syntax">"since the relation in question is one-to-various."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">Memory::I7_array_free</span><span class="plain-syntax">(</span><span class="identifier-syntax">right_second</span><span class="plain-syntax">, </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">, </span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Memory::I7_array_free</span><span class="plain-syntax">(</span><span class="identifier-syntax">right_first</span><span class="plain-syntax">, </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">, </span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Memory::I7_array_free</span><span class="plain-syntax">(</span><span class="identifier-syntax">right_counts</span><span class="plain-syntax">, </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">, </span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Memory::I7_array_free</span><span class="plain-syntax">(</span><span class="identifier-syntax">left_second</span><span class="plain-syntax">, </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">, </span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Memory::I7_array_free</span><span class="plain-syntax">(</span><span class="identifier-syntax">left_first</span><span class="plain-syntax">, </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">, </span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Memory::I7_array_free</span><span class="plain-syntax">(</span><span class="identifier-syntax">left_counts</span><span class="plain-syntax">, </span><span class="constant-syntax">OBJECT_COMPILATION_MREASON</span><span class="plain-syntax">, </span><span class="identifier-syntax">nc</span><span class="plain-syntax">, </span><span class="reserved-syntax">sizeof</span><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax">));</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="4-ks.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-km.html">1</a></li><li class="progresschapter"><a href="2-ins.html">2</a></li><li class="progresschapter"><a href="3-prp.html">3</a></li><li class="progresscurrentchapter">4</li><li class="progresssection"><a href="4-is.html">is</a></li><li class="progresssection"><a href="4-vs.html">vs</a></li><li class="progresssection"><a href="4-is2.html">is2</a></li><li class="progresssection"><a href="4-ks.html">ks</a></li><li class="progresscurrent">rs</li><li class="progresssection"><a href="4-pp.html">pp</a></li><li class="progresssection"><a href="4-cos.html">cos</a></li><li class="progresschapter"><a href="5-inf.html">5</a></li><li class="progressnext"><a href="4-pp.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

